using System;
using System.Reflection;
using SwinGame;
using Color = System.Drawing.Color;
using System.Diagnostics;

namespace Jumpman.src
{
    public class GameMain
    {
        public static void Main()
        {
            //Set the path to the application so the resource manager can
            //find the files it needs to load.
            Resources.SetAppPath(Assembly.GetExecutingAssembly().Location, true);
            //Start the audio system.
            Audio.OpenAudio();

            Core.OpenGraphicsWindow("Jumpman", 800, 600);
            GameController gc = new GameController();
                        //Run the game loop
            while (!Core.WindowCloseRequested())
            {
                //Fetch the next back of UI interaction
                
                Graphics.ClearScreen();
                Core.ProcessEvents();
                gc.Update();
                gc.Draw();


                Text.DrawFramerate(0, 0); //Draw framerate top left

                //Draw onto the screen
                Core.RefreshScreen(60);
            }

            //End the audio
            Audio.CloseAudio();
            Resources.ReleaseAllResources();
        }
        
    }
}
